home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48hor1 / hp42s.doc < prev    next >
Text File  |  1995-03-31  |  5KB  |  95 lines

  1. "So ya wanna run HP-42 programs on yer 48, do ya?  Piece o' cake!" 
  2.  
  3.                HP42S  by Joseph K. Horn  15 Oct 1990 
  4.                An HP-42-to-48/41-Emulator translator 
  5.  
  6.    Files: The HP42S directory contains two files: TR42 and TAB42. 
  7.  
  8.    Requirements: HP-42S, HP-48SX "41CV Emulator Card", and 
  9. James Donnelly's Tool Library (for the REPLACE function). 
  10.  
  11.    Purpose: Allows you to run HP-42S programs on the HP 48SX. 
  12.  
  13.    Method: "Print" the program from the 42 to the 48, translate it 
  14. into 41 code using the TR42 program, and run it using the 41 Emulator 
  15. Card. 
  16.  
  17.    Theory: The 41 Emulator Card allows HP-41 programs to run on the 
  18. HP 48S.  So it would seem that it should be able to run HP-42 
  19. programs too, since the 42 is so much like the 41.  But it can't, 
  20. because so many functions got renamed in the 42.  For example, the 
  21. "CHS" function in the 41 was renamed to "+/-" in the 42.  There were 
  22. so many changes, that Zengrange decided that the extra code required 
  23. to handle the 42 was not worth the bother, especially since the 42 
  24. does not have external program storage ability, which makes the 
  25. demand for 42->48 ability minimal.  All we have to do, though, is 
  26. replace the new command names with the old ones, plus a little minor 
  27. reformatting, and the Emulator will "think" it's a 41 program.  This 
  28. editing process can be automatically & quickly done by running TR42. 
  29.  
  30.     INSTRUCTIONS: 
  31.  
  32. (1) On the HP-42, execute 0 DELAY. 
  33. (2) Get the 42 and 48 ready for I/R transfer: 
  34.     (a) Elevate the 42 by resting it on top of Donnelly's manual for 
  35.         the Programmer's Toolkit (it's just the right height). 
  36.     (b) Point them "head to head" with their "HEWLETT"s directly 
  37.         across from each other. 
  38.     (c) On the 42, press PRP.  Don't press the program name yet, but 
  39.         make sure it's in the menu. 
  40. (3) Transfer the program from the 42 to the 48: 
  41.     (a) Press INPRT on the 48. 
  42.     (b) Within 10 seconds, press the program name on the 42. 
  43. (4) When transfer is done, see the program as a string in level 2 
  44.     and a 1 or 0 in level 1.  If 0, try the transfer again.  If 1, 
  45.     it may have been a good transfer; attempt translation now: 
  46.     with the program string in level 1, execute TR42. 
  47. (5) Check the result by down-arrowing through it. 
  48.  
  49. Q. What does TR42 do? 
  50. A. It: 
  51.    (a) removes the unnecessary program line 00; 
  52.    (b) replaces all CHR 4's (printer linefeeds) with CHR 10's 
  53.        (newline characters); 
  54.    (c) replaces all double quotes with single quotes (for Emulator); 
  55.    (d) removes all unnecessary ST's in stack-register commands; 
  56.    (e) removes all those blobs on LBL lines; 
  57.    (f) changes the 42's special multiplication symbol into "*"; 
  58.    (g) changes the 42's special division symbol into "/"; and 
  59.    (h) replaces all 42 commands with their 41 equivalent, as listed 
  60.        on pages 171-172 of the 42 Owner's Manual.  For example, all 
  61.        occurrences of "+/-" get replaced by "CHS".  There are 20 
  62.        commands which are searched for and replaced. 
  63.  
  64. Q. How fast does TR42 run? 
  65. A. Several seconds for a small program; several more for a large one. 
  66.    This speed is possible due to the use of the REPLACE function in 
  67.    the HP 48 Programmer's ToolKit by James Donnelly. 
  68.  
  69. Q. I don't own the 41 Emulator Card; is TR42 of any use to me? 
  70. A. Yes; it takes INPRT strings, which are not really editable, and 
  71.    makes them useable. 
  72.  
  73. Q. What does TR42 do with 42 commands that have no 41 equivalent? 
  74. A. Nothing.  They are left alone so that you may create your own 41 
  75.    Emulator command extensions (see manual) to emulate them, if you 
  76.    wish.  Otherwise, programs containing such commands (like AGRAPH) 
  77.    cannot be run by the Emulator. 
  78.  
  79. Q. What do I do with the program string that TR42 yields? 
  80. A. Whatever you please.  You can EDIT it.  You can PR1 it.  You can 
  81.    STO it.  You can ->41 it.  You can even DROP it. 
  82.  
  83. Q. Can the list of functions that are searched for and replaced be 
  84.    changed? 
  85. A. Yes, very easily.  The file "TAB42" is a lookup table of pairs of 
  86.    42/41 commands.  For example, the first pair is { "+/-" "CHS" }. 
  87.    You may easily add pairs or delete pairs from this list, and TR42 
  88.    will be happy to use your customized TAB42. 
  89.  
  90. Q. In that case, can TR42 be used as a generic "global search and 
  91.    replace" engine? 
  92. A. No, due to the other 42-specific work that it does. 
  93.  
  94. Joseph K. Horn   --   (714) 858-0920   --   Peripheral Vision, Ltd. 
  95.